package com.briup.cms.dao;

import com.briup.cms.bean.Role_Privilege;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface Role_PrivilegeMapper {

    @Results({
            @Result(column = "role_id",property = "roleId"),
            @Result(column = "privilege_id",property = "privilegeId")
    })

    @Select("select * from cms_role_privilege")
    List<Role_Privilege>selectAll();

    @Insert("insert into cms_role_privilege values(null,#{roleId},#{privilegeId})")
    void insert(Role_Privilege role_privilege);

    @Update("update cms_role_privilege set role_id=#{roleId},privilege_id=#{privilegeId} where id=#{id}")
    void update(Role_Privilege role_privilege);

    @Delete("delete from cms_role_privilege where id=#{id}")
    void deleteById(Long id);
}
